# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DisplayVideo.V1.Model.BudgetSummary do
  @moduledoc """
  Summarized information of an individual campaign budget.

  ## Attributes

  *   `externalBudgetId` (*type:* `String.t`, *default:* `nil`) - Corresponds to the external_budget_id of a campaign budget. If the value is not set in the campaign budget, this field will be empty.
  *   `preTaxAmountMicros` (*type:* `String.t`, *default:* `nil`) - The sum of charges made under this budget before taxes, in micros of the invoice's currency. For example, if currency_code is `USD`, then 1000000 represents one US dollar.
  *   `prismaCpeCode` (*type:* `GoogleApi.DisplayVideo.V1.Model.PrismaCpeCode.t`, *default:* `nil`) - Relevant client, product, and estimate codes from the Mediaocean Prisma tool. Only applicable for campaign budgets with an external_budget_source of EXTERNAL_BUDGET_SOURCE_MEDIA_OCEAN.
  *   `taxAmountMicros` (*type:* `String.t`, *default:* `nil`) - The amount of tax applied to charges under this budget, in micros of the invoice's currency. For example, if currency_code is `USD`, then 1000000 represents one US dollar.
  *   `totalAmountMicros` (*type:* `String.t`, *default:* `nil`) - The total sum of charges made under this budget, including tax, in micros of the invoice's currency. For example, if currency_code is `USD`, then 1000000 represents one US dollar.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :externalBudgetId => String.t() | nil,
          :preTaxAmountMicros => String.t() | nil,
          :prismaCpeCode => GoogleApi.DisplayVideo.V1.Model.PrismaCpeCode.t() | nil,
          :taxAmountMicros => String.t() | nil,
          :totalAmountMicros => String.t() | nil
        }

  field(:externalBudgetId)
  field(:preTaxAmountMicros)
  field(:prismaCpeCode, as: GoogleApi.DisplayVideo.V1.Model.PrismaCpeCode)
  field(:taxAmountMicros)
  field(:totalAmountMicros)
end

defimpl Poison.Decoder, for: GoogleApi.DisplayVideo.V1.Model.BudgetSummary do
  def decode(value, options) do
    GoogleApi.DisplayVideo.V1.Model.BudgetSummary.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DisplayVideo.V1.Model.BudgetSummary do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
